#coding:UTF-8
from tkinter import *
import hashlib

root=Tk()

text1=Text(root,width=30,height=5)
text1.pack()

text1.insert(INSERT,"Hello,everyone,my name is Guy!")
content=text1.get('1.0',END)

#通过转化为二进制，通过摘要去进行对比
def getSig(content):
    m=hashlib.md5(content.encode())
    return m.digest()

sig=getSig(content)

def check():
    ontents=text1.get("1.0",END)
    if sig==getSig(ontents):
        print("内容不变")
    else:
        print("内容发生改变")

button1=Button(root,text="Check",command=check)
button1.pack()


mainloop()